package com.gqb.test;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import org.junit.Test;

import com.gqb.annotation.Action;
import com.gqb.annotation.Controller;
import com.gqb.util.ClassUtil;


public class frametest {
	public static void main(String[] args) throws UnsupportedEncodingException, ClassNotFoundException {
		String packageName="com.gqb.controller";
		String rootPath=ClassUtil.class.getResource("/").getPath();
		rootPath = URLDecoder.decode(rootPath, "utf-8");
		File packageFile=new File(rootPath+File.separator+packageName.replace(".", File.separator));
		File[] files=packageFile.listFiles();
		for (File file : files) {
			String fileName=packageName+"."+file.getName().substring(0,file.getName().length()-".class".length());
			Class<?> fileClazz=Class.forName(fileName);
			System.out.println(fileClazz.isAnnotationPresent(Action.class));
		}
	}
}
